
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>供应商管理</title>

    <!-- Favicon -->
    <link rel="shortcut icon" th:href="@{/assets/media/image/favicon.png}"/>

    <!-- Plugin styles -->
    <link rel="stylesheet" th:href="@{/vendors/bundle.css}" type="text/css">

    <!-- Datepicker -->
    <link rel="stylesheet" th:href="@{/vendors/datepicker/daterangepicker.css}">

    <!-- Vmap -->
    <link rel="stylesheet" th:href="@{/vendors/vmap/jqvmap.min.css}">

    <!-- App styles -->
    <link rel="stylesheet" th:href="@{/assets/css/app.css}" type="text/css">
    <!--弹窗CSS-->
    <link rel="stylesheet" th:href="@{/assets/css/modal.css}" type="text/css">
</head>
<body class="container">
<!--自定义宽度-->
<!-- begin::preloader-->
<div class="preloader">
    <div class="preloader-icon"></div>
</div>
<!-- end::preloader -->

<!-- begin::header -->
<div th:replace="~{commons/header :: header}"></div>
<!-- end::header -->

<!-- begin::main -->
<div id="main">

    <!-- begin::navigation -->
    <div th:replace="~{commons/navigation :: navigation}"></div>
    <!-- end::navigation -->

    <!-- begin::main-content -->
    <div class="main-content">

        <!-- begin::page content -->
        <div class="container-fluid">

            <div class="row">
                <div class="col-md-12 card">
                    <div class="row anno">
                        <img th:src="@{/image/anno.png}">
                        供应商信息
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <tbody>
                            <tr>
                                <td>法人代表身份证</td>
                                <td th:text="${supplierMap.get('legalname')}">88923829999999</td>
                                <td>注册资金(万元)</td>
                                <td th:text="${supplierMap.get('money')}">100万元</td>
                            </tr>
                            <tr>
                                <td >税务登记证代码</td>
                                <td th:text="${supplierMap.get('tax_register_no')}">11010430033-X</td>
                                <td>经营执照编号</td>
                                <td th:text="${supplierMap.get('license_no')}">110104300991234</td>
                            </tr>
                            <tr>
                                <td>开户银行:</td>
                                <td th:text="${supplierMap.get('account_bank')}">工行找不着支行</td>
                                <td>账户:</td>
                                <td th:text="${supplierMap.get('account_no')}">020004960120008888</td>
                            </tr>
                            <tr>
                                <td>公司注册地址</td>
                                <td colspan="3" th:text="${supplierMap.get('address')}">广西</td>
                            </tr>
                            <tr>
                                <td>联系人:</td>
                                <td th:text="${supplierMap.get('link_name')}">小包</td>
                                <td>联系电话:</td>
                                <td th:text="${supplierMap.get('phone')}">12345678901</td>
                            </tr>
                            <tr>
                                <td>传真</td>
                                <td colspan="3" th:text="${supplierMap.get('fax')}">XXXXXXXXX</td>
                            </tr>
                            <tr>
                                <td>电子邮箱</td>
                                <td colspan="3" th:text="${supplierMap.get('email')}">123123123@123.123</td>
                            </tr>
                            <tr>
                                <td>煤源存放地点</td>
                                <td colspan="3" th:text="${supplierMap.get('ccr')}">山西、河北</td>
                            </tr>
                            <tr>
                                <td>运输方式及保障能力:</td>
                                <td colspan="3" th:text="${supplierMap.get('tsc')}">海运、汽运；年供应能力120万吨</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-12 card">
                    <div class="row anno">
                        <img th:src="@{/image/anno.png}">
                        审核事项
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped"> 
                            <tbody>
                            <tr>
                                <td>发起电厂:</td>
                                <td th:text="${blackApplyMap.get('company_name')}">电厂1</td>
                            </tr>
                            <tr>
                                <td>被拉黑供应商:</td>
                                <!--c1.company_name ,s.supplier_name ,b.applicant ,b.remark ,b.annex  -->
                                <td th:text="${blackApplyMap.get('supplier_name')}">供应商1</td>
                            </tr>
                            <tr>
                                <td>申请人:</td>
                                <td th:text="${blackApplyMap.get('applicant')}">小明</td>
                            </tr>
                            <tr>
                                <td>备注信息:</td>
                                <td th:text="${blackApplyMap.get('remark')}">卖假货</td>
                            </tr>  
                            <tr>
                                <td>附件:</td>
                                <td><a href="#" th:text="${blackApplyMap.get('annex')}">拉黑说明</a></td>
                            </tr>                     
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-12 card">
                    <div class="row anno">
                        <img th:src="@{/image/anno.png}">
                        拉黑审核
                    </div>
                    <div>
                        <form id="blackApply" action="" method="POST">
                           <div>
                                <span style="margin-bottom:5px;">审核意见:</span>
                                <span><textarea  cols="80" rows="6" id="auditInfo" name="auditInfo"></textarea></span>
                           </div>
                            <div>
                                <input type="submit" name="resultBtn" class="btn btn-info" onclick="flag = 'agree'"
                                       style="margin-left: 200px"
                                       value="审核通过"/>
                                <input type="submit" name="resultBtn" class="btn btn-info" onclick="flag = 'rejected'"
                                       style="margin-left: 50px"
                                       value="驳回"/>
                                <input onclick="javascript:history.go(-1)" type="button" class="btn btn-info"
                                       style="margin-left: 50px"
                                       value="返回"/>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>

        
        <!-- end::page content -->

        <!-- begin::footer -->
        <footer>
            <div class="container-fluid">
                <div>© 2019 Protable v1.0.0 Made by <a href="http://bootstrapmb.com">Laborasyon</a></div>
                <div>
                    <nav class="nav">
                        <a href="" class="nav-link">Licenses</a>
                        <a href="#" class="nav-link">Change Log</a>
                        <a href="#" class="nav-link">Get Help</a>
                    </nav>
                </div>
            </div>
        </footer>
        <!-- end::footer -->

    </div>
    <!-- end::main-content -->

</div>
<!-- end::main -->

<div th:include="~{commons/scripts :: scripts}"></div>


<!-- App scripts -->
<script th:src="@{/assets/js/app.js}"></script>
<script th:src="@{/assets/js/modal.js}"></script>

<script th:inline="javascript">
    $(() => {
        $('#blackApply').submit(function () {
            var auditInfo = $("#auditInfo").val();   //备注
            //备注信息为空
            if (auditInfo == "" || auditInfo == null) {
                alert("备注信息不能为空！");
                return false;
            } else {
                var data = $("#companyApply").serializeArray();   // 可以增加表单数据
                var auditTime = Math.round(new Date().getTime());  //审核时间
                var checkOpinion = flag;        //审核状态
                var blacklistId = [[${blackApplyMap.get('blacklist_id')}]];  //电厂推荐供应商申请id
                var supplierId=[[${blackApplyMap.get('supplier_id')}]]
                data.push({"name": "auditInfo", "value": auditInfo});
                data.push({"name": "auditTime", "value": auditTime});
                data.push({"name": "auditStatus", "value": checkOpinion});
                data.push({"name": "blacklistId", "value": blacklistId});
                data.push({"name": "supplierId", "value": supplierId});
                <!--url需要修改 -->
                let url = "/supplier/blackApplyCheck";
                $.post(url, data, function (data) {
                    if (data.code == 200) {
                        method = function () {
                            window.location.href = [[${#request.getHeader('Referer')}]]
                        }
                    }else {
                        method = function () {
                            window.location.reload();
                        }
                    }
                    let mModal1 = new mModal({
                        title: "提示", // 标题，默认：提示
                        width: "25%", // 弹出框宽度，默认 25%
                        top: "25vh", // 距离可视区域顶部距离 CSS中 margin-top 值
                        content: data.msg, // 正文，默认：正文内容
                        cancelText: "取 消", // 取消按钮文本
                        confirmText: "确 定", // 确定按钮文本
                        showCancelButton: false, // 是否显示取消按钮
                        showConfirmButton: true, // 是否显示确定按钮
                        showClose: true, // 是否显示关闭按钮
                        modal: true, // 是否需要遮罩层
                        customClass: "", // 自定义类名confirm
                        confirm: function () {
                            mModal1.close();
                            method();
                        },
                    });
                    console.log(111)
                    mModal1.renderDom();
                }, "json")
                return false;
            }
        })
    })
</script>
</body>

</html>